package com.example.wechat.model;

public class UserManager {
    private static UserManager instance;
    private User currentUser;

    private UserManager() {
        // 私有构造函数
    }

    public static UserManager getInstance() {
        if (instance == null) {
            instance = new UserManager();
        }
        return instance;
    }

    public User getCurrentUser() {
        if (currentUser == null) {
            // 默认用户信息
            currentUser = new User();
            currentUser.setWechatId("user123");
            currentUser.setNickname("微信用户");
            currentUser.setAvatar("https://example.com/default_avatar.jpg");
        }
        return currentUser;
    }

    public void setCurrentUser(User user) {
        this.currentUser = user;
    }
} 